package com.loopstack.gprint.io;

import android.content.Context;
import android.graphics.Bitmap;

import com.loopstack.gprint.utils.Command;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Vector;

public abstract class PortManager {
    String TAG = PortManager.class.getSimpleName();
    protected InputStream inputStream;
    protected OutputStream outputStream;

    public PortManager() {
    }

    public static void PortManager() {
    }

    public abstract boolean openPort();

    public boolean getConnectStatus() {
        return false;
    }

    public PrinterDevices getPrinterDevices() {
        return null;
    }

    public boolean writeDataImmediately(byte[] data) throws IOException {
        return false;
    }

    public boolean writeDataImmediately(Vector<Byte> data) throws IOException {
        return false;
    }

    public boolean writePDFToEsc(File file, int width) throws Exception {
        return false;
    }

    public boolean writePDFToTsc(File file, int printWidth, int gap, boolean cut, boolean dpi200, boolean compression, int cutHeight) throws Exception {
        return false;
    }

    public boolean writeBitmapToTsc(Bitmap bitmap, int printWidth, boolean cut, boolean dpi200, boolean compression, int cutHeight) throws Exception {
        return false;
    }

    public int getPrinterStatus(Command command) throws IOException {
        return -1;
    }

    public int getPower() throws IOException {
        return -1;
    }

    public String getPrinterModel(Command command) throws IOException {
        return "";
    }

    public byte[] getKey() throws IOException {
        return null;
    }

    public Command getCommand() {
        return null;
    }

    public void setCommand(Command command) {
    }

    public void setBlePack(int pack) {
    }

    public int readData(byte[] bytes) throws IOException {
        return 0;
    }

    public synchronized boolean closePort() {
        return false;
    }

    public synchronized InputStream getInputStream() {
        return this.inputStream;
    }

    public synchronized OutputStream getOutputStream() {
        return this.outputStream;
    }
}
